<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="./static/layui/css/layui.css">
</head>
<body>
<form class="layui-form" action="userupdate.do" method="post" onsubmit="return testphonenum()">
    <div class="layui-form-item" hidden>
        <label class="layui-form-label" >id</label>
        <div class="layui-input-block">
            <input type="text" name="id" lay-verify="title" autocomplete="off" placeholder="请输入用户名"
                   class="layui-input"  value="${user.id}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
            <input type="text" name="username" lay-verify="title" autocomplete="off" placeholder="请输入用户名"
                   class="layui-input" readonly value="${user.username}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="text" name="password" lay-verify="title" autocomplete="off" placeholder="请输入密码"
                   class="layui-input" value="${user.password}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">昵称</label>
        <div class="layui-input-block">
            <input type="text" name="nickname" lay-verify="title" autocomplete="off" placeholder="请输入昵称"
                   class="layui-input" value="${user.nickname}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <c:choose>
                <c:when test="${user.gender ge '男'}">
                    <input type="radio" name="gender" value="男" title="男" checked="">
                    <input type="radio" name="gender" value="女" title="女">
                </c:when>
                <c:when test="${user.gender ge '女'}">
                    <input type="radio" name="gender" value="男" title="男">
                    <input type="radio" name="gender" value="女" title="女" checked="">
                </c:when>
            </c:choose>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">出生日期</label>
        <div class="layui-input-inline">
            <input type="text" name="birthday" id="date" lay-verify="date"
                   autocomplete="off" class="layui-input" value="${user.birthday}">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-inline">
                <input type="tel" name="phonenum" placeholder="请输入手机号"
                       autocomplete="off" class="layui-input" value="${user.phonenum}" id="phonenum">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
</form>
</body>
<script type="text/javascript" src="./static/layui/layui.js"></script>
<script type="text/javascript" src="./static/js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="./static/js/testphonenum.js"></script>
<script>
    layui.use(['form', 'layedit', 'laydate'], function() {
        var form = layui.form,
            layer = layui.layer,
            layedit = layui.layedit,
            laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('LAY_demo_editor');

        //监听提交
        // form.on('submit(demo1)', function(data) {
        //
        // }
        );

    });
</script>
</html>
